package com.kfd.util;

import com.kfd.bean.Eadmin;

import javax.servlet.http.HttpSession;

public class UserUtil {

    public static String getUsername(HttpSession session){
        return (String) session.getAttribute("adminUserName");
    }

    public static String getUserPhone(HttpSession session){
        return (String) session.getAttribute("adminUserPhone");
    }

    public static String getLoginSms(HttpSession session,String code){
        return (String) session.getAttribute(code);
    }

    public static void setLoginSms(HttpSession session,String phone,String code){
          session.setAttribute(code,phone);
    }

    public static void setWxUser(HttpSession session,String phone){
        session.setAttribute("phone",phone);
    }
    public static String getWxUser(HttpSession session){
       return (String) session.getAttribute("phone");
    }
    public static void setWxUsermsg(HttpSession session, Eadmin eadmin){
        session.setAttribute("eadmin",eadmin);
    }
    public static Eadmin getWxUsermsg(HttpSession session){
        return (Eadmin) session.getAttribute("eadmin");
    }

    public static String getNewLoginSms(HttpSession session,String code){
        return (String) session.getAttribute(code);
    }

    public static void setNewLoginSms(HttpSession session,String phone,String code){
        session.setAttribute(code,phone);
    }

}
